﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Fly.Common.Email
{
    /// <summary>
    /// 邮件配置
    /// </summary>
    public class EmailServiceSettings
    {
        /// <summary>
        /// 初始化 <see cref="EmailServiceSettings"/> 类.
        /// </summary>
        public EmailServiceSettings()
        {
            UsePort = false;
        }


        /// <summary>
        /// 初始化 <see cref="EmailServiceSettings"/> 类.
        /// </summary>
        /// <param name="smtpService">SMTP 服务器地址.</param>
        /// <param name="port">端口号.</param>
        public EmailServiceSettings(string smtpService, int port)
        {
            SmptServer = smtpService;
            Port = port;
        }


        #region Settings Members
        /// <summary>
        /// 获取 SMPT 服务器地址.
        /// </summary>
        /// <value>The SMPT server.</value>
        public string SmptServer { get; set; }


        /// <summary>
        /// 获取发件人.
        /// </summary>
        /// <value>From.</value>
        public string From { get; set; }


        /// <summary>
        /// Gets or sets a value indicating whether [use port].
        /// </summary>
        /// <value><c>true</c> if [use port]; otherwise, <c>false</c>.</value>
        public bool UsePort { get; set; }


        /// <summary>
        /// 连接邮件服务的验证用户名.
        /// </summary>
        /// <value>The name of the authentication user.</value>
        public string AuthenticationUserName { get; set; }


        /// <summary>
        /// 连接邮件服务的验证密码.
        /// </summary>
        /// <value>The authentication password.</value>
        public string AuthenticationPassword { get; set; }


        /// <summary>
        /// 获取或设置当前邮件服务器是否需要身份验证.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is authentication required; otherwise, <c>false</c>.
        /// </value>
        public bool IsAuthenticationRequired { get; set; }


        /// <summary>
        ///获取或设置连接邮件服务器的端口号.
        /// </summary>
        /// <value>The port.</value>
        public int Port { get; set; }

        #endregion
    }
}
